var plugin = requirePlugin('WechatSI')
let manager = plugin.getRecordRecognitionManager()
Page({
  data: {
    a: '文字。。'
  },
  bindStart() {
    undefined
    manager.start({
      undefined,
      lang: 'zh_CN',
      duration: 60000
    })
  },
  touchEnd() {
    undefined
    manager.stop()
  },
  onLoad(res) {
    var that = this
    manager.onRecognize = function (res) {
      console.log("current result", res.result)
      that.setData({
        a: res.result
      })
    }
    manager.onStop = function (res) {
      console.log("record file path", res.tempFilePath)
      console.log("result", res.result)
      that.setData({
        a: res.result
      })
    }
    manager.onStart = function (res) {
      console.log("成功开始录音识别", res)
    }
    manager.onError = function (res) {
      console.error("error msg", res.msg)
    }
    manager.start({ duration: 30000, lang: "zh_CN" })
  },
})